package com.chixing.ih.interceptor;

import com.chixing.ih.util.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘岩
 * Date: 2020-09-23
 * Time: 21:59
 *
 * @version 1.0
 */
@Configuration
public class JwtInterceptor extends HandlerInterceptorAdapter {
    @Autowired
    HttpUtil httpUtil;

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        return httpUtil.doAuthorization(request, response, handler);

    }
}
